import {reqGetSearchInfoList} from "@/api";

const state ={
    searchInfoList:{}
};

const mutations ={
    GETSEARCHINFOLIST(state, searchInfoList){
        state.searchInfoList=searchInfoList
    }
};

const actions ={
    async getSearchInfoList({commit}, params={}){
        let result = await reqGetSearchInfoList(params)
        if(result.code===200){
            commit('GETSEARCHINFOLIST', result.data)
        }
    }
};

const getters ={
    goodsList(state){
        console.log(state)
        return state.searchInfoList.goodsList||[]
    },
    trademarkList(state){
        return state.searchInfoList.trademarkList||[]
    },
    attrsList(state){
        return state.searchInfoList.attrsList||[]
    }

};

export default {
    state,
    mutations,
    actions,
    getters
}